﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace MagicFight
{
    public class ManaShield : Magic
    {
        int duration = Def.ManaShieldDef.Duration;

        public ManaShield(Character caster)
            : base(caster, Def.ManaShieldDef.N)
        {
            foreach (Magic m in ps.magics)
                if (m is ManaShield && m.caster == this.caster) { m.alive = false; this.alive = false; }
            //ps.effectsManager.Add(new HolyAura(this)); 
        }

        public override void Effect(GameTime gameTime)
        {
            // O efeito desta magia está em Character.TakeDamage()
            if (!alive || lifeTime > duration) { alive = false; return; }
        }
    }
}
